<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<TITLE>
MessageBodyReader (jersey-bundle 1.9 API)
</TITLE>


<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style">

<SCRIPT type="text/javascript">
function windowTitle()
{
    if (location.href.indexOf('is-external=true') == -1) {
        parent.document.title="MessageBodyReader (jersey-bundle 1.9 API)";
    }
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>

</HEAD>

<BODY BGCOLOR="white" onload="windowTitle();">
<HR>


<!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A>
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
  <TR ALIGN="center" VALIGN="top">
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/MessageBodyReader.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
  </TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>

<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../../javax/ws/rs/ext/ExceptionMapper.html" title="interface in javax.ws.rs.ext"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../../../javax/ws/rs/ext/MessageBodyWriter.html" title="interface in javax.ws.rs.ext"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  <A HREF="../../../../index.html?javax/ws/rs/ext/MessageBodyReader.html" target="_top"><B>FRAMES</B></A>  &nbsp;
&nbsp;<A HREF="MessageBodyReader.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
&nbsp;<SCRIPT type="text/javascript">
  <!--
  if(window==top) {
    document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>');
  }
  //-->
</SCRIPT>
<NOSCRIPT>
  <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>


</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
  SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= -->

<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
<FONT SIZE="-1">
javax.ws.rs.ext</FONT>
<BR>
Interface MessageBodyReader&lt;T&gt;</H2>
<DL>
<DT><B>All Known Implementing Classes:</B> <DD><A HREF="../../../../com/sun/jersey/core/provider/jaxb/AbstractJAXBElementProvider.html" title="class in com.sun.jersey.core.provider.jaxb">AbstractJAXBElementProvider</A>, <A HREF="../../../../com/sun/jersey/core/provider/jaxb/AbstractJAXBProvider.html" title="class in com.sun.jersey.core.provider.jaxb">AbstractJAXBProvider</A>, <A HREF="../../../../com/sun/jersey/core/provider/jaxb/AbstractListElementProvider.html" title="class in com.sun.jersey.core.provider.jaxb">AbstractListElementProvider</A>, <A HREF="../../../../com/sun/jersey/core/provider/AbstractMessageReaderWriterProvider.html" title="class in com.sun.jersey.core.provider">AbstractMessageReaderWriterProvider</A>, <A HREF="../../../../com/sun/jersey/core/provider/jaxb/AbstractRootElementProvider.html" title="class in com.sun.jersey.core.provider.jaxb">AbstractRootElementProvider</A></DD>
</DL>
<HR>
<DL>
<DT><PRE>public interface <B>MessageBodyReader&lt;T&gt;</B></DL>
</PRE>

<P>
Contract for a provider that supports the conversion of a stream to a 
 Java type. To add a <code>MessageBodyReader</code> implementation, annotate the
 implementation class with <code>@Provider</code>.

 A <code>MessageBodyReader</code> implementation may be annotated
 with <A HREF="../../../../javax/ws/rs/Consumes.html" title="annotation in javax.ws.rs"><CODE>Consumes</CODE></A> to restrict the media types for which it will
 be considered suitable.
<P>

<P>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../../javax/ws/rs/ext/Provider.html" title="annotation in javax.ws.rs.ext"><CODE>Provider</CODE></A>, 
<A HREF="../../../../javax/ws/rs/Consumes.html" title="annotation in javax.ws.rs"><CODE>Consumes</CODE></A></DL>
<HR>

<P>

<!-- ========== METHOD SUMMARY =========== -->

<A NAME="method_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Method Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../javax/ws/rs/ext/MessageBodyReader.html#isReadable(java.lang.Class, java.lang.reflect.Type, java.lang.annotation.Annotation[], javax.ws.rs.core.MediaType)">isReadable</A></B>(java.lang.Class&lt;?&gt;&nbsp;type,
           java.lang.reflect.Type&nbsp;genericType,
           java.lang.annotation.Annotation[]&nbsp;annotations,
           <A HREF="../../../../javax/ws/rs/core/MediaType.html" title="class in javax.ws.rs.core">MediaType</A>&nbsp;mediaType)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Ascertain if the MessageBodyReader can produce an instance of a
 particular type.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../../../javax/ws/rs/ext/MessageBodyReader.html" title="type parameter in MessageBodyReader">T</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../javax/ws/rs/ext/MessageBodyReader.html#readFrom(java.lang.Class, java.lang.reflect.Type, java.lang.annotation.Annotation[], javax.ws.rs.core.MediaType, javax.ws.rs.core.MultivaluedMap, java.io.InputStream)">readFrom</A></B>(java.lang.Class&lt;<A HREF="../../../../javax/ws/rs/ext/MessageBodyReader.html" title="type parameter in MessageBodyReader">T</A>&gt;&nbsp;type,
         java.lang.reflect.Type&nbsp;genericType,
         java.lang.annotation.Annotation[]&nbsp;annotations,
         <A HREF="../../../../javax/ws/rs/core/MediaType.html" title="class in javax.ws.rs.core">MediaType</A>&nbsp;mediaType,
         <A HREF="../../../../javax/ws/rs/core/MultivaluedMap.html" title="interface in javax.ws.rs.core">MultivaluedMap</A>&lt;java.lang.String,java.lang.String&gt;&nbsp;httpHeaders,
         java.io.InputStream&nbsp;entityStream)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Read a type from the <CODE>InputStream</CODE>.</TD>
</TR>
</TABLE>
&nbsp;
<P>

<!-- ============ METHOD DETAIL ========== -->

<A NAME="method_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Method Detail</B></FONT></TH>
</TR>
</TABLE>

<A NAME="isReadable(java.lang.Class, java.lang.reflect.Type, java.lang.annotation.Annotation[], javax.ws.rs.core.MediaType)"><!-- --></A><H3>
isReadable</H3>
<PRE>
boolean <B>isReadable</B>(java.lang.Class&lt;?&gt;&nbsp;type,
                   java.lang.reflect.Type&nbsp;genericType,
                   java.lang.annotation.Annotation[]&nbsp;annotations,
                   <A HREF="../../../../javax/ws/rs/core/MediaType.html" title="class in javax.ws.rs.core">MediaType</A>&nbsp;mediaType)</PRE>
<DL>
<DD>Ascertain if the MessageBodyReader can produce an instance of a
 particular type. The type parameter gives the
 class of the object that should be produced, the genericType parameter
 gives the java.lang.reflect.Type of the object that should be produced.
 E.g. if the object to be produced is List<String>, the type parameter
 will be java.util.List and the genericType parameter will be
 java.lang.reflect.ParameterizedType.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>type</CODE> - the class of object to be produced.<DD><CODE>genericType</CODE> - the type of object to be produced. E.g. if the 
 message body is to be converted into a method parameter, this will be
 the formal type of the method parameter as returned by 
 <code>Method.getGenericParameterTypes</code>.<DD><CODE>annotations</CODE> - an array of the annotations on the declaration of the
 artifact that will be initialized with the produced instance. E.g. if the 
 message body is to be converted into a method parameter, this will be
 the annotations on that parameter returned by 
 <code>Method.getParameterAnnotations</code>.<DD><CODE>mediaType</CODE> - the media type of the HTTP entity, if one is not
 specified in the request then <code>application/octet-stream</code> is
 used.
<DT><B>Returns:</B><DD>true if the type is supported, otherwise false.</DL>
</DD>
</DL>
<HR>

<A NAME="readFrom(java.lang.Class, java.lang.reflect.Type, java.lang.annotation.Annotation[], javax.ws.rs.core.MediaType, javax.ws.rs.core.MultivaluedMap, java.io.InputStream)"><!-- --></A><H3>
readFrom</H3>
<PRE>
<A HREF="../../../../javax/ws/rs/ext/MessageBodyReader.html" title="type parameter in MessageBodyReader">T</A> <B>readFrom</B>(java.lang.Class&lt;<A HREF="../../../../javax/ws/rs/ext/MessageBodyReader.html" title="type parameter in MessageBodyReader">T</A>&gt;&nbsp;type,
           java.lang.reflect.Type&nbsp;genericType,
           java.lang.annotation.Annotation[]&nbsp;annotations,
           <A HREF="../../../../javax/ws/rs/core/MediaType.html" title="class in javax.ws.rs.core">MediaType</A>&nbsp;mediaType,
           <A HREF="../../../../javax/ws/rs/core/MultivaluedMap.html" title="interface in javax.ws.rs.core">MultivaluedMap</A>&lt;java.lang.String,java.lang.String&gt;&nbsp;httpHeaders,
           java.io.InputStream&nbsp;entityStream)
           throws java.io.IOException,
                  <A HREF="../../../../javax/ws/rs/WebApplicationException.html" title="class in javax.ws.rs">WebApplicationException</A></PRE>
<DL>
<DD>Read a type from the <CODE>InputStream</CODE>.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>type</CODE> - the type that is to be read from the entity stream.<DD><CODE>genericType</CODE> - the type of object to be produced. E.g. if the 
 message body is to be converted into a method parameter, this will be
 the formal type of the method parameter as returned by 
 <code>Method.getGenericParameterTypes</code>.<DD><CODE>annotations</CODE> - an array of the annotations on the declaration of the
 artifact that will be initialized with the produced instance. E.g. if the 
 message body is to be converted into a method parameter, this will be
 the annotations on that parameter returned by 
 <code>Method.getParameterAnnotations</code>.<DD><CODE>mediaType</CODE> - the media type of the HTTP entity.<DD><CODE>httpHeaders</CODE> - the read-only HTTP headers associated with HTTP entity.<DD><CODE>entityStream</CODE> - the <CODE>InputStream</CODE> of the HTTP entity. The
 caller is responsible for ensuring that the input stream ends when the
 entity has been consumed. The implementation should not close the input stream.
<DT><B>Returns:</B><DD>the type that was read from the stream.
<DT><B>Throws:</B>
<DD><CODE>java.io.IOException</CODE> - if an IO error arises
<DD><CODE><A HREF="../../../../javax/ws/rs/WebApplicationException.html" title="class in javax.ws.rs">WebApplicationException</A></CODE> - if a specific 
 HTTP error response needs to be produced. Only effective if thrown prior
 to the response being committed.</DL>
</DD>
</DL>
<!-- ========= END OF CLASS DATA ========= -->
<HR>


<!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A>
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
  <TR ALIGN="center" VALIGN="top">
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/MessageBodyReader.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
  </TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>

<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../../javax/ws/rs/ext/ExceptionMapper.html" title="interface in javax.ws.rs.ext"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../../../javax/ws/rs/ext/MessageBodyWriter.html" title="interface in javax.ws.rs.ext"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  <A HREF="../../../../index.html?javax/ws/rs/ext/MessageBodyReader.html" target="_top"><B>FRAMES</B></A>  &nbsp;
&nbsp;<A HREF="MessageBodyReader.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
&nbsp;<SCRIPT type="text/javascript">
  <!--
  if(window==top) {
    document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>');
  }
  //-->
</SCRIPT>
<NOSCRIPT>
  <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>


</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
  SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->

<HR>
Copyright &#169; 2011 <a href="http://www.oracle.com/">Oracle Corporation</a>. All Rights Reserved.
</BODY>
</HTML>
